<template>
  <div id="app">
    <router-view></router-view>
  </div>
</template>
<script>
import { getAdminToken } from './utils/auth'

export default {
  created () {
    const hasToken = getAdminToken()

    if (hasToken) {
      this.$router.replace('/login')
    } else {
      this.$router.push('/homepage')
    }
  }
}
</script>
